<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		var  arr = [657,56,75,67,5,67];

		var num1 = 0;
		var num2 = 0;


		for (var i in arr) {
			if(i%2==0){
				num1 += arr[i];
			}else{
				num2 += arr[i];
			}
		}





		var  tempArr = [];

		for (var i = 0; i < arr.length; i++) {
			tempArr[arr.length-1-i] = arr[i]
		}

		// document.write(tempArr);













		tempArr = [];
		index = 0;
		for (var i = arr.length - 1; i >= 0; i--) {
			tempArr[index] = arr[i];
			index++;
		}

		// [67,5,67,75,56,657]
		// 
		// 
		// 
		
		function push(arr,num) {
			arr[arr.length] = num;
			return arr;
		}

		function unshift(arr,num) {
			tempArr = [];
			tempArr[0] = num;

			// for(var i in arr){
			// 	tempArr[Number(i)+1] = arr[i];
			// }

			for (var i = 0; i <arr.length; i++) {
				tempArr[i+1] = arr[i];
			}

			return tempArr;
		}


		function pop(arr) {
			tempArr = [];

			for (var i = 0; i < arr.length-1; i++) {
				tempArr[i] = arr[i]
			}

			return tempArr;
		}

		function shift(arr) {
			tempArr = [];

			for (var i = 1; i < arr.length; i++) {
				tempArr[i-1] = arr[i]
			}

			return tempArr;
		}

		function del(arr,index,length) {
			tempArr = [];
			start = index;
			end = index+length-1;
			num = 0
			for (var i =0; i < arr.length; i++) {
				if(i<start || i>end){
					tempArr[num] = arr[i];
					num++;
				}
			}

			return tempArr;
		}

		// pop([546,45,64,56]);
		 res = del([546,45,64,56,657,3,3,3,3],3,3); 

		 document.write(res);
		// 
		// 


		// res = push([67,34,543],90);
		// res = unshift([67,34,543],90);

		// [90,67,34,543]

		// document.write(res);





		


		// abc([345,43,53],90);


		// [345,43,53,90]


	</script>
</head>
<body>
	
</body>
</html>